
#include "include/jsoniter.hpp"

using namespace std;
using namespace jsoniter;

class Student
{
    class Faver {
    public:
        string Fav;
        JSONITER_DECLARE(Fav)
        JSONITER_BINDING("fav:true")
    };

public:
    string Name;
    int Age;
    Faver Fa;
    JSONITER_DECLARE(Name, Age, Fa)
    JSONITER_BINDING("name:true", "age:true", "fa:true ")
};

int main()
{
    Student person;
    std::string errMsg;
    //JsonHelper::JsonToObject(person, R"({"name":"XiaoMing", "age":15})");
    bool ret = JsonHelper::JsonToObject(person, R"({"name":"XiaoMing", "age":12, "fa":{"fav":"123"}})", {}, &errMsg);
    if(!ret){

    }

    //string jsonStr;
    //JsonHelper::ObjectToJson(person, jsonStr);
    return 0;
}